package cn.iocoder.yudao.module.trade.service.drainage.bo;

import lombok.Data;
import org.apache.commons.lang3.StringUtils;

@Data
public class VivoClientBO {

    private String clientId;
    private String secret;
    private String state;
    private String srcId;
    private String pageUrl;
    private boolean enable;
    private boolean available;

    public VivoClientBO(String clientId, String secret, String state, boolean enable) {
        this.clientId = clientId;
        this.secret = secret;
        this.state = state;
        this.enable = enable;
    }

    public VivoClientBO() {}

    public boolean isAvailable() {
        return StringUtils.isNoneEmpty(clientId)
                && StringUtils.isNoneEmpty(state)
                && StringUtils.isNoneEmpty(secret);
    }

    public boolean isEnable() {
        return enable;
    }

    @Override
    public String toString() {
        return String.format("clientId: %s, secret: %s, state: %s, enable: %s", clientId, secret, secret, enable);
    }
}
